Combined authentication and encryption

ABSTRACT

A system and methods are provided for establishing an authenticated and encrypted communication connection between two devices with at most two round-trip communications. During establishment of an initial authenticated, encrypted communication connection (or afterward), a first device (e.g., a server) provides the second device (e.g., a client) with a token (e.g., a challenge) that lives or persists beyond the current connection. After that connection is terminated and the second device initiates a new connection, it uses the token as part of the handshaking process to reduce the necessary round-trip communications to one.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of and claims the benefit of priorityto U.S. patent application Ser. No. 14/945,649, titled “CombinedAuthentication and Encryption,” filed on Nov. 19, 2015, which iscontinuation of and claims the benefit of priority to U.S. patentapplication Ser. No. 14/045,192, titled “Combined Authentication andEncryption,” filed on Oct. 3, 2013, which are hereby incorporated byreference in their entireties.

BACKGROUND

This invention relates to the field of electronic communications. Moreparticularly, a system and methods are provided for establishing acombined authenticated and encrypted communication connection betweentwo devices with minimal round-trip handshaking.

As the use of mobile communication platforms continues to grow, usersoperate more and more applications that require creation and maintenanceof separate communication connections. Each application may require aseparate connection with a different server or service. With so manyconnections being created, possibly each time the user opens anapplication, it becomes noticeable if establishment of a connection fora particular application is slow and his or her use of the applicationis delayed.

Traditional methods of reliably authenticating a user and establishing asecure communication connection can require many round-tripcommunications between a user's device and a server. This may beacceptable in a traditional computing environment (e.g., with desktop orother stationary computing devices having wired connections), but isunacceptable in a mobile environment (e.g., with smart phones andportable computing devices having wireless connections) and can markedlydelay a user's connection. To speed their connections, some applicationsforego encryption and/or reliable authentication, but this leaves theirusers vulnerable to data theft, spoofing and/or other cyber assaults.

SUMMARY

In some embodiments of the invention, a system and methods are providedfor establishing an authenticated and encrypted communication connectionbetween two devices, such as a client device (e.g., a smart phone, amobile computing device) and a server hosting an application executed onthe client device.

In these embodiments, at most two round-trip communications between thedevices are required to establish the authenticated and encryptedconnection, but only a single round-trip is required in many or mostsituations. This optimization is enabled through the use of a token orchallenge that has an extended lifetime (i.e., beyond the currentconnection in which it is provided). Whereas such a token traditionallywould be valid for only the time necessary to establish a session or, atmost, for the length of that session, in these embodiments a token maypersist for a longer period of time (e.g., one hour, four hours, eighthours).

DESCRIPTION OF THE FIGURES

FIG. 1 is a block diagram depicting a communication environment in whichsome embodiments of the invention may be implemented.

FIG. 2 is a time sequence diagram illustrating methods of establishing acombined authenticated and secure communication connection, inaccordance with some embodiments of the invention.

FIG. 3 depicts a communication server for establishing a combinedauthenticated and secure communication connection, in accordance withsome embodiments of the invention.

DETAILED DESCRIPTION

The following description is presented to enable any person skilled inthe art to make and use the invention. Various modifications to thedisclosed embodiments will be readily apparent to those skilled in theart, and the general principles defined herein may be applied to otherembodiments and applications without departing from the scope of thepresent invention. Thus, the present invention is not intended to belimited to the embodiments shown.

In some embodiments of the invention, a system and methods are providedfor rapid creation of an authenticated, secure (i.e., encrypted)communication connection between two devices (e.g., a client andserver). In these embodiments, the number of round-trip handshakingcommunications necessary to establish the authenticated, secureconnection may depend on how recently the two devices have been activelycommunicating.

Illustratively, if the devices have recently communicated via anauthenticated and encrypted connection, they may use an artifact ortoken of that recent communication connection as a challenge or seed forcreating a new connection with just a single round-trip exchange ofinformation. If they have not recently communicated, multiple (e.g.,two) round-trips may be required.

FIG. 1 is a diagram of a communication environment in which someembodiments of the invention may be implemented. In these embodiments,communication devices 110 operated by users 112 host the same ordifferent operating systems (e.g., Android, BlackBerry, iOS, Nokia S40,Symbian, Windows Phone), and execute any number of applications thatrequire interaction with a central server or service.

For example, application 120 a executing on device 110 a allows text,images, audio, video and/or other electronic information to be exchangedbetween device 110 a and one or more other devices 110 via datacommunication channels that transit system 130 and that conform to anywireless data communication technologies now known or hereafterdeveloped (e.g., Wi-Fi). Rather than relying upon traditional wirelessvoice communication channels that provide limited support for instant orreal-time communications other than live voice conversations, some orall of the data communication channels established to supportapplication 120 a allow unconstrained exchange of virtually all types ofcommunications and media between devices of the same and/or differenttypes.

Application 120 a is hosted by system 130, which is a data center orother cooperative collection of computer resources, includingcommunication servers 132, state servers 134 and/or other components.Communication servers 132 are front-end components of system 130 thathost users' connections with the system and that facilitate the exchangeof communications between users. Servers 132 may be referred to as“chat” servers, in that they receive real-time messages and chat sessioncommunications from individual users for delivery to one or more otherusers. Servers 132 may support either or both individual chat sessions(i.e., between two users) and group chat sessions (i.e., more than twousers).

Illustratively, as long as a user is on-line with system 130 and theapplication is executing on his or her device, a connection or sessionmay be maintained between the device and a communication server 132.When the user closes the application on the device, his or herconnection may persist for some period of time (e.g., five minutes,fifteen minutes).

State servers 134 maintain states or statuses of users and/or users'devices. Thus, a state server stores some or all of a user's profile,including applicable preferences (e.g., preferred audible and/or visualalert, status message), user identifier, device type/model and/or otherdevice details, other persistent data, etc. Some status informationmaintained by a state server with regard to a user may persist for theduration of the user's connection with system 130 and/or some period oftime afterward. As the user's device operates in different ways ordifferent modes, goes offline, comes online and so on, a state servermay capture those changes and may distribute that information toassociated users (e.g., friends, users who recently chatted with theuser).

Network(s) 150 comprise communication paths between devices 110 andsystem 130, and may include data and/or voice communication channels.For carrying data communications, networks 150 may comprise theInternet, one or more intranets, LANs (Local Area Networks), WANs (WideArea Networks) and/or other point-to-point or distributed connections,which may be wired or wireless. For carrying voice communications,network(s) 150 may comprise wired and/or wireless voice communicationlinks managed by different telecommunication service providers andimplementing virtually any wireless technology, such as Global Systemfor Mobile Communications (GSM), Enhanced Data Rates for GSM Evolution(EDGE), Long-Term Evolution (LTE), Code Division Multiple Access (CDMA),Evolution-Data Optimized (EV-DO) and so on.

Networks 150 may thus comprise various entities not shown in FIG. 1,such as routers, gateways, switches, base stations (e.g., wirelessaccess points, Node Bs, Evolved Node Bs) and/or other equipment forestablishing, maintaining, switching or otherwise manipulating a dataand/or voice connection.

In some embodiments of the invention, a client device operating anapplication hosted by system 130 initiates and establishes an encryptedand authenticated communication connection with the system with no morethan two round-trip communications between the device and the system.When re-connecting after being disconnected for a limited period oftime, the device can initiate and establish an encrypted andauthenticated communication connection with just a single round-tripcommunication.

FIG. 2 is a time sequence diagram illustrating methods of establishing acombined authenticated and secure communication connection, according tosome embodiments of the invention.

In these embodiments, client device 210 (e.g., a smart phone, a portablecomputing device) must connect to server 230, which hosts an applicationsuch as application 120 a of FIG. 1, and which uses 802.11 datacommunication connections and/or other data communications compatiblewith the wireless technologies identified above. Other embodiments ofthe invention may be implemented for use with other applicationscompatible with device 210.

At time 240, a user of client 210 activates or opens the application andan initial Client Hello message is dispatched toward server 230, whichmay be one of multiple servers hosting the application. The applicationexecutes under the host operating system of the client device, but insome implementations the operating system platform (e.g., iOS, WindowsPhone) does not allow the application to be woken or otherwise activatedby server 230. In these implementations, therefore, a connection betweenthe application on the client device and the application on the servercannot be initiated until the user activates the application on client210.

The client hello message may identify the client and/or the user (e.g.,by user identifier, by username, by device identifier), and may includea protocol identifier (e.g., to indicate that the client can apply aprotocol to perform authentication and encryption together) and/or otherinformation. For example, a client-generated value may be included foruse in generating a token or shared secret. In the illustratedimplementation, the client hello is not encrypted, but in otherimplementations it may be encrypted (e.g., in the single round-tripmethod described below).

In response to the client hello message, server 230 returns a ServerHello message and a token that will be used to finalize theauthenticated and encrypted connection. The server hello message mayconfirm the protocol in use, provide a session identifier and/or mayinclude other information. The token may be considered a serverchallenge and may be randomly generated (e.g., on the order of 32 byteslong).

At 242, client 210 generates a session key for the new connection anduses it to generate a set of data (i.e., AuthData) that will allowserver 230 to authenticate client 210 (and the user) and confirmencryption of the connection. The brackets indicate that the AuthDatamessage is encrypted.

In some embodiments, the session key (SK) is generated by applying asuitable function to a set of data that includes the server-providedtoken and a secret shared between the client and the server. Anexemplary shared secret is the user's password for the communicationapplication, which is known at the client device and at the serverbefore the connection process of FIG. 2 commences. In someimplementations, the user may not know or be aware of the passwordbecause the application may automatically store it on the client device(upon generation by the system that hosts the application), and produceit as needed without requiring action by the user.

One suitable function for generating the session key is PBKDF2(Password-Based Key Derivation Function 2). When PBKDF2 is used, the“password” parameter for the function may be the application passwordfor the user/device, and the “salt” parameter may be the server token;the hashing function may be HMAC SHA1 (Hash-Based Message AuthenticationCode/Secure Hash Algorithm 1).

The number of iterations used within the function may be on the order of1,024, but this may vary depending on the configuration of device 210(e.g., the type/speed of its processor). The length of the session keymay vary from one embodiment to another, but an illustrative length is20 bytes.

Session key SK is then used with a suitable encryption scheme,preferably a stream cipher (or state cipher) such as RC4™ (Rivest Cipher4), to generate the authentication data AuthData. Specifically, usingRC4, the keystream is generated from SK and is applied to encrypt aplaintext string to produce AuthData.

Composition of the plaintext string may differ from one embodiment toanother, but an illustrative string is composed of concatenated (orotherwise combined) strings representing the user ID, the server token,a timestamp and some data specific to the device (e.g., user agent,device type or model, device ID).

The same encryption scheme (e.g., RC4) may be used during the connection(after it is established) to secure communications between the clientand the server. In some implementations, the “drop X” option is appliedto generate an initial X bytes with the cipher and discard them beforeencrypting AuthData. Illustrative values of X are 256, 512, 1,024, etc.

Thus, at 242, client 210 generates session key SK and uses it to encrypta string of data known to the client and server 230. The encrypted setof AuthData is then sent to the server.

Upon receipt of the encrypted AuthData, which the server was expectingafter sending its hello message and the token, the server willseparately generate what it thinks should be the session key (or may doso anytime after sending the server hello+token message), using the sameprocess and parameters as the client. Assuming that it obtains theappropriate session key SK, server 230 proceeds to decrypt the encryptedAuthData.

Once decrypted, the server parses the plaintext to verify that itcontains correct or appropriate information. For example, it alreadyknows the user ID and token, and can therefore verify that those valuesin AuthData are correct. It can also verify that the timestamp field isformatted correctly and could perform a validity check (e.g., todetermine that the indicated time is after the server hello message andwithin an appropriate range of time). The server can also verify thatthe device-specific string is something that the server recognizes (andperhaps that it matches information stored at the system in server 230,or another system component such as a state server).

Assuming that the server can decrypt AuthData and verify its contents,client 210 and the user have been authenticated and the client andserver have agreed upon an encryption scheme for encrypting some or allcommunications they exchange from this point on. Server 230 will issue aSuccess message acknowledging successful completion of the connectionprocess. Thus, at 244, client 210 and server 230 have established anauthenticated and encrypted communication connection.

Further, however, at 250 the server sends a new or future token toclient 210 which, as described below, can be used by the client tore-connect to server 230 after their current connection ends.Illustratively, the connection may be terminated when the applicationterminates on device 210 (e.g., when the user closes it or opens anotherapplication), when device 210 is rebooted, when an extended period oftime passes with no application activity, etc.

In some embodiments of the invention, this newToken is included in thesuccess message that finalizes the current connection, or in a latercommunication during the same connection. Also in some embodiments, theserver may periodically send a replacement for this new token during thepresent connection. The lifetime of the unsolicited token (as opposed tothe solicited token the server dispatched in response to the clienthello message sent at 240) may be on the order of 1 hour, 2 hours, 4hours, etc., but in these embodiments is valid beyond termination of thecurrent connection. The new token may be stored at system 230 and/or atsome other system component, such as a state server.

Different users/devices or types of users/devices may be supplied withtokens with different lifetimes (e.g., based on device platform,geographical location, frequency or level of use of the application).Because the client may not be advised of the lifetime or expiration ofthe newToken, it may simply use it for the next connection attemptregardless of the amount of time that has elapsed since the previousconnection terminated.

An embodiment of establishing an authenticated and encryptedcommunication connection with just a single round-trip communication isillustrated in FIG. 2 starting at 260. Because the communicationconnection established above (between 240 and 244) has been terminatedfor some period of time, client 210 and server 230 have no existingconnection at 260, or at least no connection that supports theapplication.

At 260 the user of client device 210 opens the application again.Therefore, the client device issues a new client hello message towardserver 230, but in this scenario includes a new encrypted set ofAuthData.

The encrypted newAuthData sent at 260 is generated in the same manner asthe previous AuthData. In particular, using the newToken sent by theserver at 250 (or sent at some other time), and the user/device passwordor some other shared secret, client 210 generates a new session key SK.Using a suitable encryption scheme, key SK is used to encrypt a stringcomposed of specified information (e.g., user ID, newToken, a timestampand device-specific data) to produce newAuthData.

Upon receipt of the encrypted newAuthData at 270, server 230 identifiesclient 210 (e.g., from the client hello) and generates its own versionof the session key, using the last token provided to client 210 (i.e.,newToken), and attempts to decrypt newAuthData. If the encryptednewAuthData was received within the lifetime of newToken (i.e., timeperiod 290≤lifetime of newToken), the server should generate the correctkey SK and be able to decrypt newAuthData to retrieve and verify thespecified information as described above. The server will respond to thenew client hello and newAuthData at 280 a or 280 b, depending on whetheror not newToken is still valid at 270 (and whether it is received fromthe same client).

In particular, if server 230 successfully decrypts newAuthData, at 280 ait returns a Success message (or other message to the same effect), andthe client and the server have established a new authenticated andencrypted communication connection with one round-trip communication.

If, however, newToken had expired by the time server 230 received thenewAuthData message at 270, the authentication/encryption process simplydegenerates into a two round-trip process, with half of the firstround-trip complete. Specifically, the server treats the client helloand newAuthData message received at 270 as a new client hello (andignore newAuthData), and will respond at 280 b with a server hello and anew token/challenge (i.e., Token2). The client will use that token tocreate and encrypt another set of authentication data to send to theserver as AuthData2. Server 230 will decrypt AuthData2 to authenticatethe user/device, verify that proper encryption has been established andcomplete the new connection.

In embodiments of the invention, the newToken provided to client 210from server 230 at 250 is valid for a single connection attempt. If theclient somehow uses the wrong token in a connection attempt, the servermay simply respond as if the client was attempting an initialconnection, and send back a new token for use in generating and sendinga new set of AuthData.

FIG. 3 is a block diagram of a communication server for establishing anauthenticated and encrypted communication connection according to someembodiments of the invention. Although only a single server 300 isdepicted, it will be understood that a system, site or service hosting acompatible application may comprise any number of communication serversand/or other components (e.g., state servers) that cooperate to executethe application and support user connections.

Communication server of FIG. 3 comprises processor 302, memory 304 andstorage 306, which may comprise one or more optical and/or magneticstorage components. Server 300 may be coupled (permanently ortransiently) to keyboard 312, pointing device 314 and display 316. Thecommunication server may include other components omitted in theinterest of clarity, such as communication modules for communicating viawired and/or wireless communication links, interface components forinterfacing with other external devices such as storage devices, a proxyserver, a router, a load balancer, web servers, other system servers,etc.

Storage 306 of the apparatus stores logic that may be loaded into memory304 for execution by processor 302. Such logic includes connection logic322, authentication/encryption logic 324 and application logic 326.Memory 304 may also store various data generated or used by server 300,such as tokens (e.g., challenges), user passwords, device parameters andso on, which may also be permanently stored in storage 306.

Connection logic 322 comprises processor-executable instructions forreceiving and managing connections with devices operated by users of theapplication hosted by server 300. These instructions may allow server300 to identify connection requests, apply the correct protocol(s) toestablish/maintain connections, terminate connections, exchange protocolmessages that support the application, etc.

Authentication/encryption logic 324 comprises processor-executableinstructions for authenticating a user/device and for encrypting anddecrypting information (e.g., messages, communications) exchanged withuser devices. In some embodiments, logic 322 and logic 324 are merged;in other embodiments they are further subdivided. In these embodiments,however, connection logic, authentication logic and encryption logiccooperate to support establishment of authenticated and encryptedcommunication connections with one or two round-trip communications witha client device, as described above.

Application logic 326 comprises processor-executable instructions forreceiving communications from users of the application and deliveringthem to other users. These communications are delivered in real-time ifthe recipient(s) are online and connected to server 300 (or acooperating server). If a recipient is offline, a message may betemporarily stored (e.g., on a message server) for later delivery.

An environment in which some embodiments of the invention are executedmay incorporate a general-purpose computer or a special-purpose devicesuch as a hand-held computer or communication device. Some details ofsuch devices (e.g., processor, memory, data storage, display) may beomitted for the sake of clarity. A component such as a processor ormemory to which one or more tasks or functions are attributed may be ageneral component temporarily configured to perform the specified taskor function, or may be a specific component manufactured to perform thetask or function. The term “processor” as used herein refers to one ormore electronic circuits, devices, chips, processing cores and/or othercomponents configured to process data and/or computer program code.

Data structures and program code described in this detailed descriptionare typically stored on a non-transitory computer-readable storagemedium, which may be any device or medium that can store code and/ordata for use by a computer system. Non-transitory computer-readablestorage media include, but are not limited to, volatile memory,non-volatile memory, magnetic and optical storage devices such as diskdrives, magnetic tape, CDs (compact discs) and DVDs (digital versatilediscs or digital video discs), solid-state drives and/or othernon-transitory computer-readable media now known or later developed.

Methods and processes described in the detailed description can beembodied as code and/or data, which can be stored in a non-transitorycomputer-readable storage medium as described above. When a processor orcomputer system reads and executes the code and manipulates the datastored on the medium, the processor or computer system performs themethods and processes embodied as code and data structures and storedwithin the medium.

The foregoing descriptions of embodiments of the invention have beenpresented for purposes of illustration and description only. They arenot intended to be exhaustive or to limit the invention to the formsdisclosed. Accordingly, many modifications and variations will beapparent to practitioners skilled in the art. The scope of the inventionis defined by the appended claims, not the preceding disclosure.

What is claimed is:
 1. A method comprising: providing a device with afirst unsolicited token during an authenticated first communicationconnection, wherein the first unsolicited token is associated with alifetime during which the first unsolicited token remains valid and thelifetime is selected based on a type of the device or a type of userassociated with the device; receiving encrypted authentication datagenerated from the first unsolicited token from the device aftertermination of the authenticated first communication connection; and: ifthe encrypted authentication data was received within the lifetime ofthe first unsolicited token, decrypting the encrypted authenticationdata and establishing a second communication connection based on thedecrypted authentication data, or if the encrypted authentication datawas not received within the lifetime of the first unsolicited token,providing the device with a second token configured to authenticate thesecond communication connection.
 2. The method of claim 1, whereindecrypting the encrypted authentication data comprises: generating asession key from the first unsolicited token; and decrypting theencrypted authentication data with the session key.
 3. The method ofclaim 1, wherein the authentication data comprises: an identifier of auser of the device; the first unsolicited token or the second token; anddevice-specific data.
 4. The method of claim 3, wherein the identifierof the user of the device is a telephone number associated with theuser.
 5. The method of claim 1, wherein the first unsolicited token is atoken sent to the device as part of a periodic token replacementschedule.
 6. A non-transitory computer readable medium storinginstructions that, when executed by one or more processors, cause theone or more processors to: provide a device with a first unsolicitedtoken during an authenticated first communication connection, whereinthe first unsolicited token is associated with a lifetime during whichthe first unsolicited token remains valid and the lifetime is selectedbased on a type of the device or a type of user associated with thedevice; receive encrypted authentication data generated from the firstunsolicited token from the device after termination of the authenticatedfirst communication connection; and: if the encrypted authenticationdata was received within the lifetime of the first unsolicited token,decrypting the encrypted authentication data and establishing a secondcommunication connection based on the decrypted authentication data, orif the encrypted authentication data was not received within thelifetime of the first unsolicited token, providing the device with asecond token configured to authenticate the second communicationconnection.
 7. The medium of claim 6, wherein decrypting the encryptedauthentication data comprises: generating a session key from the firstunsolicited token; and decrypting the encrypted authentication data withthe session key.
 8. The medium of claim 6, wherein the authenticationdata comprises: an identifier of a user of the device; the firstunsolicited token or the second token; and device-specific data.
 9. Themedium of claim 8, wherein the identifier of the user of the device is atelephone number associated with the user.
 10. The medium of claim 6,wherein the first unsolicited token is a token sent to the device aspart of a periodic token replacement schedule.
 11. A system comprising:a processor; and memory configured to store instructions that, whenexecuted by the processor, cause the system to: provide a device with afirst unsolicited token during an authenticated first communicationconnection, wherein the first unsolicited token is associated with alifetime during which the first unsolicited token remains valid and thelifetime is selected based on a type of the device or a type of userassociated with the device; receive encrypted authentication datagenerated from the first unsolicited token from the device aftertermination of the authenticated first communication connection; and: ifthe encrypted authentication data was received within the lifetime ofthe first unsolicited token, decrypting the encrypted authenticationdata and establishing a second communication connection based on thedecrypted authentication data, or if the encrypted authentication datawas not received within the lifetime of the first unsolicited token,providing the device with a second token configured to authenticate thesecond communication connection.
 12. The apparatus of claim 11, whereindecrypting the encrypted authentication data comprises: generating asession key from the first unsolicited token; and decrypting theencrypted authentication data with the session key.
 13. The apparatus ofclaim 11, wherein the authentication data comprises: an identifier of auser of the device; the first unsolicited token or the second token; anddevice-specific data.
 14. The apparatus of claim 13, wherein theidentifier of the user of the device is a telephone number associatedwith the user.